-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update elastic #2047
Update elastic #2047
Conversation
Reviewer's Guide by SourceryThis PR enhances the elastic transform functionality by adding support for different noise distributions (Gaussian and uniform) in displacement field generation. The implementation refactors the displacement field generation code into a separate function and adds a new parameter to control the noise distribution type. Updated class diagram for ElasticTransformclassDiagram
class ElasticTransform {
+float alpha
+float sigma
+bool approximate
+bool same_dxdy
+Literal["gaussian", "uniform"] noise_distribution
+int mask_interpolation
+float p
+get_params_dependent_on_data(params: dict[str, Any], data: dict[str, Any]) dict[str, Any]
+get_transform_init_args_names() tuple[str, ...]
}
note for ElasticTransform "Added noise_distribution attribute and updated methods to use it."
Updated class diagram for generate_displacement_fields functionclassDiagram
class generate_displacement_fields {
+np.ndarray image_shape
+float alpha
+float sigma
+bool same_dxdy
+tuple[int, int] kernel_size
+np.random.Generator random_generator
+Literal["gaussian", "uniform"] noise_distribution
+generate_noise_field() np.ndarray
}
note for generate_displacement_fields "Refactored to include noise_distribution and generate_noise_field function."
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @ternaus - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider expanding the PR description to explain the motivation for adding the new noise distribution option and its expected benefits. This helps reviewers and future maintainers understand the context better.
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2047 +/- ##
=========================================
+ Coverage 0 90.31% +90.31%
=========================================
Files 0 46 +46
Lines 0 7597 +7597
=========================================
+ Hits 0 6861 +6861
- Misses 0 736 +736 ☔ View full report in Codecov by Sentry. |
Fixes: #2046
Summary by Sourcery
Add support for configurable noise distribution in the ElasticTransform class, allowing users to select between Gaussian and uniform distributions for displacement fields. Refactor related functions for improved clarity and update the pre-commit configuration to the latest Ruff version.
New Features:
Enhancements:
Build: